import hasPermission from './permission/hasPermission'
import hasRole from './permission/hasRole'
import Vue from 'vue'

const install = function (Vue) {
  Vue.directive('hasPermission', hasPermission)
  Vue.directive('hasRole', hasRole)
}

if (window.Vue) {
  // <el-button v-has-permission="['dispatch:waitShipQuery:careShipLock']"
  // 在系统菜单里 对应的菜单下 建立按钮, 然后自定义一个权限符: :  , 然后配置给某个角色, 这样用户就可以获取到权限信息了,
  window['hasPermission'] = hasPermission
  window['hasRole'] = hasRole
  Vue.use(install) // eslint-disable-line
}

export default install
